enum { gestaltVMBackingStoreFileRefNum = 'vmbs' };
The result of this selector is an file reference number to the active "VM Storage" file.
You can convert that reference number to an FSSpec by calling PBGetFCBInfoSync
,
as shown below:
static OSErr FindVMStorage(FSSpec *fss) { OSErr err; long gestaltResult; FCBPBRec fcbPB; err = Gestalt(gestaltVMBackingStoreFileRefNum, &gestaltResult); if (err == noErr) { fcbPB.ioNamePtr = fss->name; fcbPB.ioVRefNum = 0; fcbPB.ioRefNum = gestaltResult; fcbPB.ioFCBIndx = 0; err = PBGetFCBInfoSync(&fcbPB); } if (err == noErr) { fss->vRefNum = fcbPB.ioFCBVRefNum; fss->parID = fcbPB.ioFCBParID; } return err; }